package com.isi.mtl.lf.ex3.actions;

import java.util.ArrayList;

import javax.faces.model.SelectItem;

import com.isi.mtl.lf.ex3.entites.Camion;
import com.isi.mtl.lf.ex3.managers.CamionManager;

public class ListeCamionAction {
	
	public static ArrayList<SelectItem> getListeActionItem(int idModele) {
		ArrayList<SelectItem> alSi = new ArrayList<SelectItem>();
		ArrayList<Camion> alCamions = CamionManager.getCamionByIdModele(idModele);
		
		for(Camion c : alCamions) {
			System.out.println("Listecamionaction id"+c.getIdModele());
			SelectItem sI = new SelectItem(c.getIdCamion(), c.get_commentaires());
			alSi.add(sI);
		}
		
		return alSi;
	}
	
	public static Camion getDetailCamion(int id){
		Camion c;
		c = CamionManager.getCamionByCamionId(id);
		return c;
	}
	

	
}
